package Day;

import java.util.ArrayList;
import java.util.Scanner;

public class Day1 {


    //数字统计
    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int L=scanner.nextInt();
        int R=scanner.nextInt();
        int count=0;
        for (int i = L; i <=R ; i++) {
            int x=i;
            while(x!=0){
                if(x%10==2)count++;
                x/=10;
            }
        }
        System.out.println(count);
    }

//两个数组的交集
    public ArrayList<Integer> intersection(ArrayList<Integer>nums1,ArrayList<Integer>nums2){
        boolean []hash=new boolean[1001];
        for(int x:nums1){
            hash[x]=true;
        }
        ArrayList<Integer>ret=new ArrayList<>();
        for(int x:nums2){
            if(hash[x]){
                ret.add(x);
                hash[x]=false;
            }
        }
        return ret;
    }

    public static void main(String[]args){
        Scanner in=new Scanner(System.in);
        String s=in.next();
        char[]ch=s.toCharArray();

        StringBuffer sb=new StringBuffer();

        for(int i=0;i<ch.length;i++){
        char c=ch[i];
        if(sb.length()!=0&&sb.charAt(sb.length()-1)==c){
            sb.deleteCharAt(sb.length()-1);
        }else {
            sb.append(c);
        }

        }
        System.out.println(sb.toString());
    }





}
